﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace SharpTRI
{
    class Xors3D
    {
        // Log levels
        public const int LOG_NO = 5;
        public const int LOG_FATAL = 4;
        public const int LOG_ERROR = 3;
        public const int LOG_WARNING = 2;
        public const int LOG_MESSAGE = 1;
        public const int LOG_INFO = 0;

        // Log targets
        public const int LOG_HTML = 1;
        public const int LOG_COUT = 2;
        public const int LOG_STRING = 4;

        // Skinning types
        public const int SKIN_SOFTWARE = 2;
        public const int SKIN_HARDWARE = 1;

        // Light sources types
        public const int LIGHT_DIRECTIONAL = 1;
        public const int LIGHT_POINT = 2;
        public const int LIGHT_SPOT = 3;

        // Texture filtering
        public const int TF_NONE = 0;
        public const int TF_POINT = 1;
        public const int TF_LINEAR = 2;
        public const int TF_ANISOTROPIC = 3;
        public const int TF_ANISOTROPICX4 = 4;
        public const int TF_ANISOTROPICX8 = 5;
        public const int TF_ANISOTROPICX16 = 6;

        // PixelShader versions
        public const int PS_1_1 = 0;
        public const int PS_1_2 = 1;
        public const int PS_1_3 = 2;
        public const int PS_1_4 = 3;
        public const int PS_2_0 = 4;
        public const int PS_3_0 = 5;

        // VertexShader versions
        public const int VS_1_1 = 0;
        public const int VS_2_0 = 1;
        public const int VS_3_0 = 2;

        // Matrix semantics
        public const int WORLD = 0;
        public const int WORLDVIEWPROJ = 1;
        public const int VIEWPROJ = 2;
        public const int VIEW = 3;
        public const int PROJ = 4;
        public const int WORLDVIEW = 5;
        public const int VIEWINVERSE = 6;
        public const int WORLDINVERSETRANSPOSE = 15;
        public const int WORLDINVERSE = 16;
        public const int WORLDTRANSPOSE = 17;
        public const int VIEWPROJINVERSE = 18;
        public const int VIEWPROJINVERSETRANSPOSE = 19;
        public const int VIEWTRANSPOSE = 20;
        public const int VIEWINVRSETRANSPOSE = 21;
        public const int PROJINVERSE = 22;
        public const int PROJTRANSPOSE = 23;
        public const int PROJINVRSETRANSPOSE = 24;
        public const int WORLDVIEWPROJTRANSPOSE = 25;
        public const int WORLDVIEWPROJINVERSE = 26;
        public const int WORLDVIEWPROJINVERSETRANSPOSE = 27;
        public const int WORLDVIEWTRANSPOSE = 28;
        public const int WORLDVIEWINVERSE = 29;
        public const int WORLDVIEWINVERSETRANSPOSE = 30;

        // Antialiasing types
        public const int AANONE = 0;
        public const int AA2SAMPLES = 1;
        public const int AA3SAMPLES = 2;
        public const int AA4SAMPLES = 3;
        public const int AA5SAMPLES = 4;
        public const int AA6SAMPLES = 5;
        public const int AA7SAMPLES = 6;
        public const int AA8SAMPLES = 7;
        public const int AA9SAMPLES = 8;
        public const int AA10SAMPLES = 9;
        public const int AA11SAMPLES = 10;
        public const int AA12SAMPLES = 11;
        public const int AA13SAMPLES = 12;
        public const int AA14SAMPLES = 13;
        public const int AA15SAMPLES = 14;
        public const int AA16SAMPLES = 15;

        // Camera fog mode
        public const int FOG_NONE = 0;
        public const int FOG_LINEAR = 1;

        // Camera projection mode
        public const int PROJ_DISABLE = 0;
        public const int PROJ_PERSPECTIVE = 1;
        public const int PROJ_ORTHOGRAPHIC = 2;

        // Entity FX flags
        public const int FX_NOTHING = 0;
        public const int FX_FULLBRIGHT = 1;
        public const int FX_VERTEXCOLOR = 2;
        public const int FX_FLATSHADED = 4;
        public const int FX_DISABLEFOG = 8;
        public const int FX_DISABLECULLING = 16;
        public const int FX_NOALPHABLEND = 32;

        // Entity blending modes
        public const int BLEND_ALPHA = 1;
        public const int BLEND_MULTIPLY = 2;
        public const int BLEND_ADD = 3;
        public const int BLEND_PUREADD = 4;

        // Compare functions
        public const int CMP_NEVER = 1;
        public const int CMP_LESS = 2;
        public const int CMP_EQUAL = 3;
        public const int CMP_LESSEQUAL = 4;
        public const int CMP_GREATER = 5;
        public const int CMP_NOTEQUAL = 6;
        public const int CMP_GREATEREQUAL = 7;
        public const int CMP_ALWAYS = 8;

        // Axis
        public const int AXIS_X = 1;
        public const int AXIS_Y = 2;
        public const int AXIS_Z = 3;

        // Texture loading flags
        public const int FLAGS_COLOR = 1;
        public const int FLAGS_ALPHA = 2;
        public const int FLAGS_MASKED = 4;
        public const int FLAGS_MIPMAPPED = 8;
        public const int FLAGS_CLAMPU = 16;
        public const int FLAGS_CLAMPV = 32;
        public const int FLAGS_SPHERICALENVMAP = 64;
        public const int FLAGS_CUBICENVMAP = 128;
        public const int FLAGS_R32F = 256;
        public const int FLAGS_SKIPCACHE = 512;
        public const int FLAGS_VOLUMETEXTURE = 1024;
        public const int FLAGS_ARBG16F = 2048;
        public const int FLAGS_ARBG32F = 4096;

        // Texture blending modes
        public const int TEXBLEND_NONE = 0;
        public const int TEXBLEND_ALPHA = 1;
        public const int TEXBLEND_MULTIPLY = 2;
        public const int TEXBLEND_ADD = 3;
        public const int TEXBLEND_DOT3 = 4;
        public const int TEXBLEND_LIGHTMAP = 5;
        public const int TEXBLEND_SEPARATEALPHA = 6;

        // Cube map faces
        public const int FACE_LEFT = 0;
        public const int FACE_FORWARD = 1;
        public const int FACE_RIGHT = 2;
        public const int FACE_BACKWARD = 3;
        public const int FACE_UP = 4;
        public const int FACE_DOWN = 5;

        // Entity animation types
        public const int ANIMATION_STOP = 0;
        public const int ANIMATION_LOOP = 1;
        public const int ANIMATION_PINGPONG = 2;
        public const int ANIMATION_ONE = 3;

        // Collision types
        public const int SPHERETOSHPHERE = 1;
        public const int SPHERETOBOX = 3;
        public const int SPHERETOTRIMESH = 2;

        // Collision respones types
        public const int RESPONSE_STOP = 1;
        public const int RESPONSE_SLIDING = 2;
        public const int RESPONSE_SLIDING_DOWNLOCK = 3;

        // Entity picking modes
        public const int PICK_NONE = 0;
        public const int PICK_SPHERE = 1;
        public const int PICK_TRIMESH = 2;
        public const int PICK_BOX = 3;

        // Sprite view modes
        public const int SPRITE_FIXED = 1;
        public const int SPRITE_FREE = 2;
        public const int SPRITE_FREEROLL = 3;
        public const int SPRITE_FIXEDYAW = 4;

        // Joystick types
        public const int JOY_NONE = 0;
        public const int JOY_DIGITAL = 1;
        public const int JOY_ANALOG = 2;

        // Cubemap rendering modes
        public const int CUBEMAP_SPECULAR = 1;
        public const int CUBEMAP_DIFFUSE = 2;
        public const int CUBEMAP_REFRACTION = 3;

        // Shadow's blur levels
        public const int SHADOWS_BLUR_NONE = 0;
        public const int SHADOWS_BLUR_3 = 1;
        public const int SHADOWS_BLUR_5 = 2;
        public const int SHADOWS_BLUR_7 = 3;
        public const int SHADOWS_BLUR_11 = 4;
        public const int SHADOWS_BLUR_13 = 5;


        // primitives types
        public const int PRIMITIVE_POINTLIST = 1;
        public const int PRIMITIVE_LINELIST = 2;
        public const int PRIMITIVE_LINESTRIP = 3;
        public const int PRIMITIVE_TRIANGLELIST = 4;
        public const int PRIMITIVE_TRIANGLESTRIP = 5;
        public const int PRIMITIVE_TRIANGLEFAN = 6;

        // line separator types
        public const int LS_NUL = 0;
        public const int LS_CR = 1;
        public const int LS_LF = 2;
        public const int LS_CRLF = 3;

        // physics: joint types
        public const int JOINT_POINT2POINT = 0;
        public const int JOINT_6DOF = 1;
        public const int JOINT_6DOFSPRING = 2;
        public const int JOINT_HINGE = 3;

        // physics: debug drawer modes
        public const int PXDD_NO = 0;
        public const int PXDD_WIREFRAME = 1;
        public const int PXDD_AABB = 2;
        public const int PXDD_CONTACTS = 4;
        public const int PXDD_JOINTS = 8;
        public const int PXDD_JOINT_LIMITS = 16;

        // physics: ray casting modes
        public const int PXRC_SINGLE = 0;
        public const int PXRC_MULTIPLE = 1;
		[DllImport("Xors3d.dll")] 
		public static extern int xCreateLine3D(float fromX, float fromY, float fromZ, float toX, float toY, float toZ, int red = 255, int green = 255, int blue = 255, int alpha = 255, bool useZBuffer = true);
        [DllImport("Xors3d.dll")] 
		public static extern void xLine3DOrigin(int line3d, float x, float y, float z, bool isGlobal = false);
        [DllImport("Xors3d.dll")] 
		public static extern void xLine3DAddNode(int line3d, float x, float y, float z, bool isGlobal = false);
        [DllImport("Xors3d.dll")] 
		public static extern void xLine3DColor(int line3d, int red, int green, int blue, int alpha);
        [DllImport("Xors3d.dll")] 
		public static extern void xLine3DUseZBuffer(int line3d, bool state);
        [DllImport("Xors3d.dll")] 
		public static extern float xLine3DOriginX(int line3d, bool isGlobal = false);
        [DllImport("Xors3d.dll")] 
		public static extern float xLine3DOriginY(int line3d, bool isGlobal = false);
        [DllImport("Xors3d.dll")] 
		public static extern float xLine3DOriginZ(int line3d, bool isGlobal = false);
        [DllImport("Xors3d.dll")] 
		public static extern int xLine3DNodesCount(int line3d);
        [DllImport("Xors3d.dll")] 
		public static extern void xLine3DNodePosition(int line3d, int index, float x, float y, float z, bool isGlobal = false);
        [DllImport("Xors3d.dll")] 
		public static extern float xLine3DNodeX(int line3d, int index, bool isGlobal = false);
        [DllImport("Xors3d.dll")] 
		public static extern float xLine3DNodeY(int line3d, int index, bool isGlobal = false);
        [DllImport("Xors3d.dll")] 
		public static extern float xLine3DNodeZ(int line3d, int index, bool isGlobal = false);
        [DllImport("Xors3d.dll")] 
		public static extern int xLine3DRed(int line3d);
        [DllImport("Xors3d.dll")] 
		public static extern int xLine3DGreen(int line3d);
        [DllImport("Xors3d.dll")] 
		public static extern int xLine3DBlue(int line3d);
        [DllImport("Xors3d.dll")] 
		public static extern int xLine3DAlpha(int line3d);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetLine3DUseZBuffer(int line3d);
        [DllImport("Xors3d.dll")] 
		public static extern void xDeleteLine3DNode(int line3d, int index);
        [DllImport("Xors3d.dll")] 
		public static extern void xClearLine3D(int line3d);
        
        // brushes commands
        [DllImport("Xors3d.dll")] 
		public static extern int xLoadBrush(string path, int flags = 9, float xScale = 1.0f, float yScale = 1.0f);
        [DllImport("Xors3d.dll")] 
		public static extern int xCreateBrush(float red = 255.0f, float green = 255.0f, float blue = 255.0f);
        [DllImport("Xors3d.dll")] 
		public static extern void xFreeBrush(int brush);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetBrushTexture(int brush, int index = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xBrushColor(int brush, int red, int green, int blue);
        [DllImport("Xors3d.dll")] 
		public static extern void xBrushAlpha(int brush, float alpha);
        [DllImport("Xors3d.dll")] 
		public static extern void xBrushShininess(int brush, float shininess);
        [DllImport("Xors3d.dll")] 
		public static extern void xBrushBlend(int brush, int blend);
        [DllImport("Xors3d.dll")] 
		public static extern void xBrushFX(int brush, int FX);
        [DllImport("Xors3d.dll")] 
		public static extern void xBrushTexture(int brush, int texture, int frame = 0, int index = 0);
        [DllImport("Xors3d.dll")] 
		public static extern string xGetBrushName(int brush);
        [DllImport("Xors3d.dll")] 
		public static extern void xBrushName(int brush, string name);
        [DllImport("Xors3d.dll")] 
		public static extern float xGetBrushAlpha(int brush);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetBrushBlend(int brush);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetBrushRed(int brush);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetBrushGreen(int brush);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetBrushBlue(int brush);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetBrushFX(int brush);
        [DllImport("Xors3d.dll")] 
		public static extern float xGetBrushShininess(int brush);
        
        // cameras commands
        [DllImport("Xors3d.dll")] 
		public static extern void xCameraFogMode(int camera, int mode);
        [DllImport("Xors3d.dll")] 
		public static extern void xCameraFogColor(int camera, int red, int green, int blue);
        [DllImport("Xors3d.dll")] 
		public static extern void xCameraFogRange(int camera, float nearRange, float farRange);
        [DllImport("Xors3d.dll")] 
		public static extern void xCameraClsColor(int camera, int red, int green, int blue);
        [DllImport("Xors3d.dll")] 
		public static extern void xCameraProjMode(int camera, int mode);
        [DllImport("Xors3d.dll")] 
		public static extern void xCameraClsMode(int camera, int clearColor, int clearZBuffer);
        [DllImport("Xors3d.dll")] 
		public static extern int xSphereInFrustum(int camera, float x, float y, float z, float radii);
        [DllImport("Xors3d.dll")] 
		public static extern void xCameraClipPlane(int camera, int index, bool enabled, float a, float b, float c, float d);
        [DllImport("Xors3d.dll")] 
		public static extern void xCameraRange(int camera, float nearRange, float farRange);
        [DllImport("Xors3d.dll")] 
		public static extern void xCameraViewport(int camera, int x, int y, int width, int height);
        [DllImport("Xors3d.dll")] 
		public static extern void xCameraCropViewport(int camera, int x, int y, int width, int height);
        [DllImport("Xors3d.dll")] 
		public static extern int xCreateCamera(int parent = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xCameraProject(int camera, float x, float y, float z);
        [DllImport("Xors3d.dll")] 
		public static extern void xCameraProject2D(int camera, int x, int y, float zDistance);
        [DllImport("Xors3d.dll")] 
		public static extern float xProjectedX();
        [DllImport("Xors3d.dll")] 
		public static extern float xProjectedY();
        [DllImport("Xors3d.dll")] 
		public static extern float xProjectedZ();
        [DllImport("Xors3d.dll")] 
		public static extern int xGetViewMatrix(int camera);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetProjectionMatrix(int camera);
        [DllImport("Xors3d.dll")] 
		public static extern void xCameraZoom(int camera, float zoom);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetViewProjMatrix(int camera);
        
        // collisions commands
        [DllImport("Xors3d.dll")] 
		public static extern void xCollisions(int srcType, int destType, int collideMethod, int response);
        [DllImport("Xors3d.dll")] 
		public static extern void xClearCollisions();
        [DllImport("Xors3d.dll")] 
		public static extern void xResetEntity(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityRadius(int entity, float xRadius, float yRadius = 0.0f);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityBox(int entity, float x, float y, float z, float width, float height, float depth);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityType(int entity, int typeID, bool recurse = false);
        [DllImport("Xors3d.dll")] 
		public static extern int xEntityCollided(int entity, int typeID);
        [DllImport("Xors3d.dll")] 
		public static extern int xCountCollisions(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern float xCollisionX(int entity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern float xCollisionY(int entity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern float xCollisionZ(int entity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern float xCollisionNX(int entity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern float xCollisionNY(int entity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern float xCollisionNZ(int entity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern float xCollisionTime(int entity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern int xCollisionEntity(int entity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern int xCollisionSurface(int entity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern int xCollisionTriangle(int entity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetEntityType(int entity);
        
        // constants commands
        [DllImport("Xors3d.dll")] 
		public static extern void xRenderPostEffect(int poly);
        [DllImport("Xors3d.dll")] 
		public static extern int xCreatePostEffectPoly(int camera, int mode);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetFunctionAddress(string name);
        
        // effects commands
        [DllImport("Xors3d.dll")] 
		public static extern int xLoadFXFile(string path);
        [DllImport("Xors3d.dll")] 
		public static extern void xFreeEffect(int effect);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetEntityEffect(int entity, int effect, int index = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetSurfaceEffect(int surface, int effect, int index = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetBonesArrayName(int entity, string arrayName, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xSurfaceBonesArrayName(int surface, string arrayName, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetEffectInt(int entity, string name, int value, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xSurfaceEffectInt(int surface, string name, int value, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetEffectFloat(int entity, string name, float value, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xSurfaceEffectFloat(int surface, string name, float value, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetEffectBool(int entity, string name, bool value, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xSurfaceEffectBool(int surface, string name, bool value, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetEffectVector(int entity, string name, float x, float y, float z, float w = 0.0f, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xSurfaceEffectVector(int surface, string name, float x, float y, float z, float w = 0.0f, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetEffectVectorArray(int entity, string name, int value, int count, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xSurfaceEffectVectorArray(int surface, string name, int value, int count, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xSurfaceEffectMatrixArray(int surface, string name, int value, int count, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xSurfaceEffectFloatArray(int surface, string name, int value, int count, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xSurfaceEffectIntArray(int surface, string name, int value, int count, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetEffectMatrixArray(int entity, string name, int value, int count, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetEffectFloatArray(int entity, string name, int value, int count, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetEffectIntArray(int entity, string name, int value, int count, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern int xCreateBufferVectors(int count);
        [DllImport("Xors3d.dll")] 
		public static extern void xBufferVectorsSetElement(int buffer, int number, float x, float y, float z, float w);
        [DllImport("Xors3d.dll")] 
		public static extern int xCreateBufferMatrix(int count);
        [DllImport("Xors3d.dll")] 
		public static extern void xBufferMatrixSetElement(int buffer, int number, int matrix);
        [DllImport("Xors3d.dll")] 
		public static extern int xBufferMatrixGetElement(int buffer, int number);
        [DllImport("Xors3d.dll")] 
		public static extern int xCreateBufferFloats(int count);
        [DllImport("Xors3d.dll")] 
		public static extern void xBufferFloatsSetElement(int buffer, int number, float value);
        [DllImport("Xors3d.dll")] 
		public static extern float xBufferFloatsGetElement(int buffer, int number);
        [DllImport("Xors3d.dll")] 
		public static extern void xBufferDelete(int buffer);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetEffectMatrixWithElements(int entity, string name, float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, float m31, float m32, float m33, float m34, float m41, float m42, float m43, float m44, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetEffectMatrix(int entity, string name, int matrix, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xSurfaceEffectMatrix(int surface, string name, int matrix, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xSurfaceEffectMatrixWithElements(int surface, string name, float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, float m31, float m32, float m33, float m34, float m41, float m42, float m43, float m44, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetEffectEntityTexture(int entity, string name, int index = 0, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetEffectTexture(int entity, string name, int texture, int frame = 0, int layer = -1, int isRecursive = 1);
        [DllImport("Xors3d.dll")] 
		public static extern void xSurfaceEffectTexture(int surface, string name, int texture, int frame = 0, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xSurfaceEffectMatrixSemantic(int surface, string name, int value, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetEffectMatrixSemantic(int entity, string name, int value, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xDeleteSurfaceConstant(int surface, string name, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xDeleteEffectConstant(int entity, string name, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xClearSurfaceConstants(int surface, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xClearEffectConstants(int entity, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetEffectTechnique(int entity, string name, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xSurfaceTechnique(int surface, string name, int layer = -1);
        [DllImport("Xors3d.dll")] 
		public static extern int xValidateEffectTechnique(int effect, string name);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetEntityShaderLayer(int entity, int layer);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetEntityShaderLayer(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetSurfaceShaderLayer(int surface, int layer);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetSurfaceShaderLayer(int surface);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetFXInt(int effect, string name, int value);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetFXFloat(int effect, string name, float value);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetFXBool(int effect, string name, bool value);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetFXVector(int effect, string name, float x, float y, float z, float w = 0.0f);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetFXVectorArray(int effect, string name, int value, int count);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetFXMatrixArray(int effect, string name, int value, int count);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetFXFloatArray(int effect, string name, int value, int count);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetFXIntArray(int effect, string name, int value, int count);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetFXEntityMatrix(int effect, string name, int matrix);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetFXTexture(int effect, string name, int texture, int frame = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetFXMatrixSemantic(int effect, string name, int value);
        [DllImport("Xors3d.dll")] 
		public static extern void xDeleteFXConstant(int effect, string name);
        [DllImport("Xors3d.dll")] 
		public static extern void xClearFXConstants(int effect);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetFXTechnique(int effect, string name);
        
        // emitters commands
        [DllImport("Xors3d.dll")] 
		public static extern int xCreateEmitter(int psystem, int parent = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xEmitterEnable(int emitter, bool state);
        [DllImport("Xors3d.dll")] 
		public static extern int xEmitterEnabled(int emitter);
        [DllImport("Xors3d.dll")] 
		public static extern int xEmitterGetPSystem(int emitter);
        [DllImport("Xors3d.dll")] 
		public static extern int xEmitterAddParticle(int emitter);
        [DllImport("Xors3d.dll")] 
		public static extern void xEmitterFreeParticle(int emitter, int particle);
        [DllImport("Xors3d.dll")] 
		public static extern int xEmitterValidateParticle(int emitter, int particle);
        [DllImport("Xors3d.dll")] 
		public static extern int xEmitterCountParticles(int emitter);
        [DllImport("Xors3d.dll")] 
		public static extern int xEmitterGetParticle(int emitter, int index);
        [DllImport("Xors3d.dll")] 
		public static extern int xEmitterAlive(int emitter);
        
        // entity_animation commands
        [DllImport("Xors3d.dll")] 
		public static extern int xExtractAnimSeq(int entity, int firstFrame, int lastFrame, int sequence = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xLoadAnimSeq(int entity, string path);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetAnimSpeed(int entity, float speed, string rootBone = "");
        [DllImport("Xors3d.dll")] 
		public static extern float xAnimSpeed(int entity, string rootBone = "");
        [DllImport("Xors3d.dll")] 
		public static extern int xAnimating(int entity, string rootBone = "");
        [DllImport("Xors3d.dll")] 
		public static extern float xAnimTime(int entity, string rootBone = "");
        [DllImport("Xors3d.dll")] 
		public static extern void xAnimate(int entity, int mode = 1, float speed = 1.0f, int sequence = 0, float translate = 0.0f, string rootBone = "");
        [DllImport("Xors3d.dll")] 
		public static extern int xAnimSeq(int entity, string rootBone = "");
        [DllImport("Xors3d.dll")] 
		public static extern float xAnimLength(int entity, string rootBone = "");
        [DllImport("Xors3d.dll")] 
		public static extern void xSetAnimTime(int entity, float time, int sequence, string rootBone = "");
        [DllImport("Xors3d.dll")] 
		public static extern void xSetAnimFrame(int entity, float frame, int sequence, string rootBone = "");
        
        // entity_control commands
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityAutoFade(int entity, float nearRange, float farRange);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityOrder(int entity, int order);
        [DllImport("Xors3d.dll")] 
		public static extern void xFreeEntity(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern int xCopyEntity(int entity, int parent = 0, int cloneBuffers = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xPaintEntity(int entity, int brush);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityShininess(int entity, float shininess);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityPickMode(int entity, int mode, bool obscurer = true, bool recursive = true);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityTexture(int entity, int texture, int frame = 0, int index = 0, int isRecursive = 1);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityFX(int entity, int fx);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetParent(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetFrustumSphere(int entity, float x, float y, float z, float radii);
        [DllImport("Xors3d.dll")] 
		public static extern void xCalculateFrustumVolume(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityParent(int entity, int parent = 0, bool isGlobal = true);
        [DllImport("Xors3d.dll")] 
		public static extern void xShowEntity(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xHideEntity(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xNameEntity(int entity, string name);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetEntityQuaternion(int entity, int quaternion);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetEntityMatrix(int entity, int matrix);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityAlpha(int entity, float alpha);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityColor(int entity, int red, int green, int blue);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntitySpecularColor(int entity, int red, int green, int blue);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityAmbientColor(int entity, int red, int green, int blue);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityEmissiveColor(int entity, int red, int green, int blue);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityBlend(int entity, int mode);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityAlphaRef(int entity, int value);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityAlphaFunc(int entity, int value);
        [DllImport("Xors3d.dll")] 
		public static extern int xCreateInstance(int entity, int parent = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xFreezeInstances(int entity, bool enable = true);
        [DllImport("Xors3d.dll")] 
		public static extern int xInstancingAvaliable();
        
        // entity_movement commands
        [DllImport("Xors3d.dll")] 
		public static extern void xScaleEntity(int entity, float x, float y, float z, bool isGlobal = false);
        [DllImport("Xors3d.dll")] 
		public static extern void xPositionEntity(int entity, float x, float y, float z, bool isGlobal = false);
        [DllImport("Xors3d.dll")] 
		public static extern void xMoveEntity(int entity, float x, float y, float z, bool isGlobal = false);
        [DllImport("Xors3d.dll")] 
		public static extern void xTranslateEntity(int entity, float x, float y, float z, bool isGlobal = false);
        [DllImport("Xors3d.dll")] 
		public static extern void xRotateEntity(int entity, float x, float y, float z, bool isGlobal = false);
        [DllImport("Xors3d.dll")] 
		public static extern void xTurnEntity(int entity, float x, float y, float z, bool isGlobal = false);
        [DllImport("Xors3d.dll")] 
		public static extern void xPointEntity(int entity1, int entity2, float roll = 0.0f);
        [DllImport("Xors3d.dll")] 
		public static extern void xAlignToVector(int entity, float x, float y, float z, int axis, float factor = 1.0f);
        
        // entity_state commands
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityDistance(int entity1, int entity2);
        [DllImport("Xors3d.dll")] 
		public static extern float xGetMatElement(int entity, int row, int col);
        [DllImport("Xors3d.dll")] 
		public static extern string xEntityClass(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetEntityBrush(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityX(int entity, bool isGlobal = false);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityY(int entity, bool isGlobal = false);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityZ(int entity, bool isGlobal = false);
        [DllImport("Xors3d.dll")] 
		public static extern int xEntityVisible(int entity, int destination);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityScaleX(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityScaleY(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityScaleZ(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityRoll(int entity, bool isGlobal = false);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityYaw(int entity, bool isGlobal = false);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityPitch(int entity, bool isGlobal = false);
        [DllImport("Xors3d.dll")] 
		public static extern string xEntityName(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern int xCountChildren(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetChild(int entity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern int xEntityInView(int entity, int camera);
        [DllImport("Xors3d.dll")] 
		public static extern int xFindChild(int entity, string name);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetEntityMatrix(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern float xGetEntityAlpha(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetAlphaRef(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetAlphaFunc(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern int xEntityRed(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern int xEntityGreen(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern int xEntityBlue(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern float xGetEntityShininess(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetEntityBlend(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetEntityFX(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern int xEntityHidden(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern int xEntitiesBBIntersect(int entity1, int entity2);
        
        // filesystems commands
        [DllImport("Xors3d.dll")] 
		public static extern int xMountPackFile(string path, string mountpoint = "", string password = "");
        [DllImport("Xors3d.dll")] 
		public static extern void xUnmountPackFile(int packfile);
        [DllImport("Xors3d.dll")] 
		public static extern int xOpenFile(string path);
        [DllImport("Xors3d.dll")] 
		public static extern int xReadFile(string path);
        [DllImport("Xors3d.dll")] 
		public static extern int xWriteFile(string path);
        [DllImport("Xors3d.dll")] 
		public static extern void xCloseFile(int file);
        [DllImport("Xors3d.dll")] 
		public static extern int xFilePos(int file);
        [DllImport("Xors3d.dll")] 
		public static extern void xSeekFile(int file, int offset);
        [DllImport("Xors3d.dll")] 
		public static extern int xFileType(string path);
        [DllImport("Xors3d.dll")] 
		public static extern int xFileSize(string path);
        [DllImport("Xors3d.dll")] 
		public static extern int xReadDir(string path);
        [DllImport("Xors3d.dll")] 
		public static extern void xCloseDir(int hndl);
        [DllImport("Xors3d.dll")] 
		public static extern string xNextFile(int hndl);
        [DllImport("Xors3d.dll")] 
		public static extern string xCurrentDir();
        [DllImport("Xors3d.dll")] 
		public static extern void xChangeDir(string path);
        [DllImport("Xors3d.dll")] 
		public static extern int xCreateDir(string path);
        [DllImport("Xors3d.dll")] 
		public static extern int xDeleteDir(string path);
        [DllImport("Xors3d.dll")] 
		public static extern int xCopyFile(string pathSrc, string pathDest);
        [DllImport("Xors3d.dll")] 
		public static extern int xDeleteFile(string path);
        [DllImport("Xors3d.dll")] 
		public static extern int xEof(int file);
        [DllImport("Xors3d.dll")] 
		public static extern int xReadByte(int file);
        [DllImport("Xors3d.dll")] 
		public static extern int xReadShort(int file);
        [DllImport("Xors3d.dll")] 
		public static extern int xReadInt(int file);
        [DllImport("Xors3d.dll")] 
		public static extern float xReadFloat(int file);
        [DllImport("Xors3d.dll")] 
		public static extern string xReadString(int file);
        [DllImport("Xors3d.dll")] 
		public static extern string xReadLine(int file, int ls_flag = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xWriteByte(int file, int value);
        [DllImport("Xors3d.dll")] 
		public static extern void xWriteShort(int file, int value);
        [DllImport("Xors3d.dll")] 
		public static extern void xWriteInt(int file, int value);
        [DllImport("Xors3d.dll")] 
		public static extern void xWriteFloat(int file, float value);
        [DllImport("Xors3d.dll")] 
		public static extern void xWriteString(int file, string value);
        [DllImport("Xors3d.dll")] 
		public static extern void xWriteLine(int file, string value, int ls_flag = 0);
        
        // fonts commands
        [DllImport("Xors3d.dll")] 
		public static extern int xLoadFont(string name, int height, bool bold = false, bool italic = false, bool underline = false, string fontface = "");
        [DllImport("Xors3d.dll")] 
		public static extern void xText(float x, float y, string textString, bool centerx = false, bool centery = false);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetFont(int font);
        [DllImport("Xors3d.dll")] 
		public static extern void xFreeFont(int font);
        [DllImport("Xors3d.dll")] 
		public static extern int xFontWidth();
        [DllImport("Xors3d.dll")] 
		public static extern int xFontHeight();
        [DllImport("Xors3d.dll")] 
		public static extern int xStringWidth(string textString);
        [DllImport("Xors3d.dll")] 
		public static extern int xStringHeight(string textString);
        
        // graphics commands
        [DllImport("Xors3d.dll")] 
		public static extern int xWinMessage(string message);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetMaxPixelShaderVersion();
        [DllImport("Xors3d.dll")] 
		public static extern void xLine(int x1, int y1, int x2, int y2);
        [DllImport("Xors3d.dll")] 
		public static extern void xRect(int x, int y, int width, int height, bool solid = false);
        [DllImport("Xors3d.dll")] 
		public static extern int xRectsOverlap(int x1, int y1, int width1, int height1, int x2, int y2, int width2, int height2);
        [DllImport("Xors3d.dll")] 
		public static extern void xViewport(int x, int y, int width, int height);
        [DllImport("Xors3d.dll")] 
		public static extern void xOval(int x, int y, int width, int height, bool solid = false);
        [DllImport("Xors3d.dll")] 
		public static extern void xOrigin(int x, int y);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetMaxVertexShaderVersion();
        [DllImport("Xors3d.dll")] 
		public static extern int xGetMaxAntiAlias();
        [DllImport("Xors3d.dll")] 
		public static extern int xGetMaxTextureFiltering();
        [DllImport("Xors3d.dll")] 
		public static extern void xSetAntiAliasType(int typeID);
        [DllImport("Xors3d.dll")] 
		public static extern void xAppTitle(string title);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetWND(int window);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetRenderWindow(int window);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetTopWindow(int window);
        [DllImport("Xors3d.dll")] 
		public static extern void xDestroyRenderWindow();
        [DllImport("Xors3d.dll")] 
		public static extern void xFlip();
        [DllImport("Xors3d.dll")] 
		public static extern int xBackBuffer();
        [DllImport("Xors3d.dll")] 
		public static extern void xLockBuffer(int buffer = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xUnlockBuffer(int buffer = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xWritePixelFast(int x, int y, System.Int32 argb, int buffer = 0);
        [DllImport("Xors3d.dll")] 
		public static extern System.Int32 xReadPixelFast(int x, int y, int buffer = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetPixels(int buffer = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xSaveBuffer(int buffer, string path);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetCurrentBuffer();
        [DllImport("Xors3d.dll")] 
		public static extern int xBufferWidth(int buffer = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xBufferHeight(int buffer = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xCatchTimestamp();
        [DllImport("Xors3d.dll")] 
		public static extern float xGetElapsedTime(int timeStamp);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetBuffer(int buffer = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetMRT(int buffer, int frame, int index);
        [DllImport("Xors3d.dll")] 
		public static extern void xUnSetMRT();
        [DllImport("Xors3d.dll")] 
		public static extern int xGetNumberRT();
        [DllImport("Xors3d.dll")] 
		public static extern int xTextureBuffer(int texture, int frame = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xLoadBuffer(int buffer, string path);
        [DllImport("Xors3d.dll")] 
		public static extern void xWritePixel(int x, int y, System.Int32 argb, int buffer = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xCopyPixel(int sx, int sy, int sourceBuffer, int dx, int dy, int destinationBuffer);
        [DllImport("Xors3d.dll")] 
		public static extern void xCopyPixelFast(int sx, int sy, int sourceBuffer, int dx, int dy, int destinationBuffer);
        [DllImport("Xors3d.dll")] 
		public static extern void xCopyRect(int sx, int sy, int sw, int sh, int dx, int dy, int sourceBuffer, int destinationBuffer);
        [DllImport("Xors3d.dll")] 
		public static extern int xGraphicsBuffer();
        [DllImport("Xors3d.dll")] 
		public static extern System.Int32 xGetColor(int x, int y);
        [DllImport("Xors3d.dll")] 
		public static extern System.Int32 xReadPixel(int x, int y, int buffer = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xGraphicsWidth(bool isVirtual = true);
        [DllImport("Xors3d.dll")] 
		public static extern int xGraphicsHeight(bool isVirtual = true);
        [DllImport("Xors3d.dll")] 
		public static extern int xGraphicsDepth();
        [DllImport("Xors3d.dll")] 
		public static extern int xColorRed();
        [DllImport("Xors3d.dll")] 
		public static extern int xColorGreen();
        [DllImport("Xors3d.dll")] 
		public static extern int xColorBlue();
        [DllImport("Xors3d.dll")] 
		public static extern void xClsColor(int red, int green, int blue, int alpha = 255);
        [DllImport("Xors3d.dll")] 
		public static extern void xClearWorld(bool entities = true, bool brushes = true, bool textures = true);
        [DllImport("Xors3d.dll")] 
		public static extern void xColor(int red, int green, int blue);
        [DllImport("Xors3d.dll")] 
		public static extern void xCls();
        [DllImport("Xors3d.dll")] 
		public static extern void xUpdateWorld(float speed = 1.0f);
        [DllImport("Xors3d.dll")] 
		public static extern void xRenderEntity(int camera, int entity, float tween = 1.0f);
        [DllImport("Xors3d.dll")] 
		public static extern void xRenderWorld(float tween = 1.0f, bool renderShadows = false);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetAutoTB(bool flag);
        [DllImport("Xors3d.dll")] 
		public static extern int xMaxClipPlanes();
        [DllImport("Xors3d.dll")] 
		public static extern void xWireframe(int state);
        [DllImport("Xors3d.dll")] 
		public static extern void xDither(int state);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetSkinningMethod(int skinMethod);
        [DllImport("Xors3d.dll")] 
		public static extern System.Int32 xTrisRendered();
        [DllImport("Xors3d.dll")] 
		public static extern int xDIPCounter();
        [DllImport("Xors3d.dll")] 
		public static extern int xSurfRendered();
        [DllImport("Xors3d.dll")] 
		public static extern int xEntityRendered();
        [DllImport("Xors3d.dll")] 
		public static extern void xAmbientLight(int red, int green, int blue, int world = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetFPS();
        [DllImport("Xors3d.dll")] 
		public static extern void xAntiAlias(int state);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetTextureFiltering(int filter);
        [DllImport("Xors3d.dll")] 
		public static extern void xStretchRect(int texture1, int x1, int y1, int width1, int height1, int texture2, int x2, int y2, int width2, int height2, int filter);
        [DllImport("Xors3d.dll")] 
		public static extern void xStretchBackBuffer(int texture, int x, int y, int width, int height, int filter);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetDevice();
        [DllImport("Xors3d.dll")] 
		public static extern void xReleaseGraphics();
        [DllImport("Xors3d.dll")] 
		public static extern void xShowPointer();
        [DllImport("Xors3d.dll")] 
		public static extern void xHidePointer();
        [DllImport("Xors3d.dll")] 
		public static extern void xCreateDSS(int width, int height);
        [DllImport("Xors3d.dll")] 
		public static extern void xDeleteDSS();
        [DllImport("Xors3d.dll")] 
		public static extern void xGridColor(int centerRed, int centerGreen, int centerBlue, int gridRed, int gridGreen, int gridBlue);
        [DllImport("Xors3d.dll")] 
		public static extern void xDrawGrid(float x, float z, int gridSize, int range);
        [DllImport("Xors3d.dll")] 
		public static extern void xDrawBBox(bool draw, bool zOn, int red, int green, int blue, int alpha);
        [DllImport("Xors3d.dll")] 
		public static extern void xGraphics3D(int width = 1024, int height = 768, int depth = 0, int mode = 0, int vsync = 1);
        [DllImport("Xors3d.dll")] 
		public static extern void xGraphicsAspectRatio(float aspectRatio);
        [DllImport("Xors3d.dll")] 
		public static extern void xGraphicsBorderColor(int red, int green, int blue);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetRenderWindow();
        [DllImport("Xors3d.dll")] 
		public static extern void xKey(string key);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetEngineSetting(string parameter, string value);
        [DllImport("Xors3d.dll")] 
		public static extern string xGetEngineSetting(string parameter);
        [DllImport("Xors3d.dll")] 
		public static extern int xHWInstancingAvailable();
        [DllImport("Xors3d.dll")] 
		public static extern int xShaderInstancingAvailable();
        [DllImport("Xors3d.dll")] 
		public static extern void xSetShaderLayer(int layer);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetShaderLayer();
        [DllImport("Xors3d.dll")] 
		public static extern void xDrawMovementGizmo(float x, float y, float z, int selectMask = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xDrawScaleGizmo(float x, float y, float z, int selectMask = 0, float sx = 1.0f, float sy = 1.0f, float sz = 1.0f);
        [DllImport("Xors3d.dll")] 
		public static extern void xDrawRotationGizmo(float x, float y, float z, int selectMask = 0, float pitch = 0.0f, float yaw = 0.0f, float roll = 0.0f);
        [DllImport("Xors3d.dll")] 
		public static extern int xCheckMovementGizmo(float x, float y, float z, int camera, int mx, int my);
        [DllImport("Xors3d.dll")] 
		public static extern int xCheckScaleGizmo(float x, float y, float z, int camera, int mx, int my);
        [DllImport("Xors3d.dll")] 
		public static extern int xCheckRotationGizmo(float x, float y, float z, int camera, int mx, int my);
        [DllImport("Xors3d.dll")] 
		public static extern void xCaptureWorld();
        [DllImport("Xors3d.dll")] 
		public static extern int xCountGfxModes();
        [DllImport("Xors3d.dll")] 
		public static extern int xGfxModeWidth(int mode);
        [DllImport("Xors3d.dll")] 
		public static extern int xGfxModeHeight(int mode);
        [DllImport("Xors3d.dll")] 
		public static extern int xGfxModeDepth(int mode);
        [DllImport("Xors3d.dll")] 
		public static extern int xGfxModeExists(int width, int height, int depth);
        [DllImport("Xors3d.dll")] 
		public static extern void xAppWindowFrame(int state);
        [DllImport("Xors3d.dll")] 
		public static extern int xMillisecs();
        [DllImport("Xors3d.dll")] 
		public static extern int xDeltaTime(bool fromInit = false);
        [DllImport("Xors3d.dll")] 
		public static extern float xDeltaValue(float value, int time = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xAddDeviceLostCallback(int func);
        [DllImport("Xors3d.dll")] 
		public static extern void xDeleteDeviceLostCallback(int func);
        
        // images commands
        [DllImport("Xors3d.dll")] 
		public static extern void xImageColor(int image, int red, int green, int blue);
        [DllImport("Xors3d.dll")] 
		public static extern void xImageAlpha(int image, float alpha);
        [DllImport("Xors3d.dll")] 
		public static extern int xImageBuffer(int image, int frame = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xCreateImage(int width, int height, int frame = 1);
        [DllImport("Xors3d.dll")] 
		public static extern void xGrabImage(int image, int x, int y, int frame = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xFreeImage(int image);
        [DllImport("Xors3d.dll")] 
		public static extern int xLoadImage(string path);
        [DllImport("Xors3d.dll")] 
		public static extern int xLoadAnimImage(string path, int width, int height, int startFrame, int frames);
        [DllImport("Xors3d.dll")] 
		public static extern void xSaveImage(int image, string path, int frame = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xDrawImage(int image, float x, float y, int frame = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xDrawImageRect(int image, float x, float y, float rectx, float recty, float rectWidth, float rectHeight, int frame = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xScaleImage(int image, float x, float y);
        [DllImport("Xors3d.dll")] 
		public static extern void xResizeImage(int image, float width, float height);
        [DllImport("Xors3d.dll")] 
		public static extern void xRotateImage(int image, float angle);
        [DllImport("Xors3d.dll")] 
		public static extern float xImageAngle(int image);
        [DllImport("Xors3d.dll")] 
		public static extern int xImageWidth(int image);
        [DllImport("Xors3d.dll")] 
		public static extern int xImageHeight(int image);
        [DllImport("Xors3d.dll")] 
		public static extern int xImagesCollide(int image1, int x1, int y1, int frame1, int image2, int x2, int y2, int frame2);
        [DllImport("Xors3d.dll")] 
		public static extern int xImageRectCollide(int image, int x, int y, int frame, int rectx, int recty, int rectWidth, int rectHeight);
        [DllImport("Xors3d.dll")] 
		public static extern int xImageRectOverlap(int image, float x, float y, float rectx, float recty, float rectWidth, float rectHeight);
        [DllImport("Xors3d.dll")] 
		public static extern int xImageXint(int image);
        [DllImport("Xors3d.dll")] 
		public static extern int xImageYint(int image);
        [DllImport("Xors3d.dll")] 
		public static extern void xintImage(int image, float x, float y);
        [DllImport("Xors3d.dll")] 
		public static extern void xMidint(int image);
        [DllImport("Xors3d.dll")] 
		public static extern void xAutoMidint(int state);
        [DllImport("Xors3d.dll")] 
		public static extern void xTileImage(int image, float x, float y, int frame = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xImagesOverlap(int image1, float x1, float y1, int image2, float x2, float y2);
        [DllImport("Xors3d.dll")] 
		public static extern void xMaskImage(int image, int red, int green, int blue);
        [DllImport("Xors3d.dll")] 
		public static extern int xCopyImage(int image);
        [DllImport("Xors3d.dll")] 
		public static extern void xDrawBlock(int image, float x, float y, int frame = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xDrawBlockRect(int image, float x, float y, float rectx, float recty, float rectWidth, float rectHeight, int frame = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xImageActualWidth(int image);
        [DllImport("Xors3d.dll")] 
		public static extern int xImageActualHeight(int image);
        
        // inputs commands
        [DllImport("Xors3d.dll")] 
		public static extern void xFlushKeys();
        [DllImport("Xors3d.dll")] 
		public static extern void xFlushMouse();
        [DllImport("Xors3d.dll")] 
		public static extern int xKeyHit(int key);
        [DllImport("Xors3d.dll")] 
		public static extern int xKeyUp(int key);
        [DllImport("Xors3d.dll")] 
		public static extern void xWaitKey();
        [DllImport("Xors3d.dll")] 
		public static extern int xMouseHit(int key);
        [DllImport("Xors3d.dll")] 
		public static extern int xKeyDown(int key);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetKey();
        [DllImport("Xors3d.dll")] 
		public static extern int xMouseDown(int key);
        [DllImport("Xors3d.dll")] 
		public static extern int xMouseUp(int key);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetMouse();
        [DllImport("Xors3d.dll")] 
		public static extern int xMouseX();
        [DllImport("Xors3d.dll")] 
		public static extern int xMouseY();
        [DllImport("Xors3d.dll")] 
		public static extern int xMouseZ();
        [DllImport("Xors3d.dll")] 
		public static extern int xMouseXSpeed();
        [DllImport("Xors3d.dll")] 
		public static extern int xMouseYSpeed();
        [DllImport("Xors3d.dll")] 
		public static extern int xMouseZSpeed();
        [DllImport("Xors3d.dll")] 
		public static extern int xMouseSpeed();
        [DllImport("Xors3d.dll")] 
		public static extern void xMoveMouse(int x, int y);
        
        // joysticks commands
        [DllImport("Xors3d.dll")] 
		public static extern int xJoyType(int portID = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xJoyDown(int key, int portID = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xJoyHit(int key, int portID = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetJoy(int portID = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xFlushJoy();
        [DllImport("Xors3d.dll")] 
		public static extern int xWaitJoy(int portID = 0);
        [DllImport("Xors3d.dll")] 
		public static extern float xJoyX(int portID = 0);
        [DllImport("Xors3d.dll")] 
		public static extern float xJoyY(int portID = 0);
        [DllImport("Xors3d.dll")] 
		public static extern float xJoyZ(int portID = 0);
        [DllImport("Xors3d.dll")] 
		public static extern float xJoyU(int portID = 0);
        [DllImport("Xors3d.dll")] 
		public static extern float xJoyV(int portID = 0);
        [DllImport("Xors3d.dll")] 
		public static extern float xJoyPitch(int portID = 0);
        [DllImport("Xors3d.dll")] 
		public static extern float xJoyYaw(int portID = 0);
        [DllImport("Xors3d.dll")] 
		public static extern float xJoyRoll(int portID = 0);
        [DllImport("Xors3d.dll")] 
		public static extern float xJoyHat(int portID = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xJoyXDir(int portID = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xJoyYDir(int portID = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xJoyZDir(int portID = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xJoyUDir(int portID = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xJoyVDir(int portID = 0);
        
        // lights commands
        [DllImport("Xors3d.dll")] 
		public static extern int xCreateLight(int typeID = 1);
        [DllImport("Xors3d.dll")] 
		public static extern void xLightShadowEpsilons(int light, float epsilon1, float epsilon2);
        [DllImport("Xors3d.dll")] 
		public static extern void xLightEnableShadows(int light, int state);
        [DllImport("Xors3d.dll")] 
		public static extern int xLightShadowsEnabled(int light);
        [DllImport("Xors3d.dll")] 
		public static extern void xLightRange(int light, float range);
        [DllImport("Xors3d.dll")] 
		public static extern void xLightColor(int light, int red, int green, int blue);
        [DllImport("Xors3d.dll")] 
		public static extern void xLightConeAngles(int light, float inner, float outer);
        
        // logging commands
        [DllImport("Xors3d.dll")] 
		public static extern int xCreateLog(int target = 1, int level = 0, string filename = "xors_log.html", string cssfilename = "");
        [DllImport("Xors3d.dll")] 
		public static extern int xCloseLog();
        [DllImport("Xors3d.dll")] 
		public static extern string xGetLogString();
        [DllImport("Xors3d.dll")] 
		public static extern void xClearLogString();
        [DllImport("Xors3d.dll")] 
		public static extern void xSetLogLevel(int level = 2);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetLogTarget(int target = 1);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetLogLevel();
        [DllImport("Xors3d.dll")] 
		public static extern int xGetLogTarget();
        [DllImport("Xors3d.dll")] 
		public static extern void xLogInfo(string message, string func = "", string file = "", int line = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xLogMessage(string message, string func = "", string file = "", int line = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xLogWarning(string message, string func = "", string file = "", int line = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xLogError(string message, string func = "", string file = "", int line = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xLogFatal(string message, string func = "", string file = "", int line = -1);
        
        // meshes commands
        [DllImport("Xors3d.dll")] 
		public static extern int xCreateMesh(int parent = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xLoadMesh(string path, int parent = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xLoadMeshWithChild(string path, int parent = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xLoadAnimMesh(string path, int parent = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xCreateCube(int parent = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xCreateSphere(int segments = 16, int parent = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xCreateCylinder(int segments = 16, bool solid = true, int parent = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xCreateTorus(int segments = 16, float R = 1.0f, float r_tube = 0.025f, int parent = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xCreateCone(int segments = 16, bool solid = true, int parent = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xCopyMesh(int entity, int parent = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xAddMesh(int source, int destination);
        [DllImport("Xors3d.dll")] 
		public static extern void xFlipMesh(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xPaintMesh(int entity, int brush);
        [DllImport("Xors3d.dll")] 
		public static extern void xFitMesh(int entity, float x, float y, float z, float width, float height, float depth, bool uniform = false);
        [DllImport("Xors3d.dll")] 
		public static extern float xMeshWidth(int entity, bool recursive = false);
        [DllImport("Xors3d.dll")] 
		public static extern float xMeshHeight(int entity, bool recursive = false);
        [DllImport("Xors3d.dll")] 
		public static extern float xMeshDepth(int entity, bool recursive = false);
        [DllImport("Xors3d.dll")] 
		public static extern void xScaleMesh(int entity, float x, float y, float z);
        [DllImport("Xors3d.dll")] 
		public static extern void xRotateMesh(int entity, float x, float y, float z);
        [DllImport("Xors3d.dll")] 
		public static extern void xPositionMesh(int entity, float x, float y, float z);
        [DllImport("Xors3d.dll")] 
		public static extern void xUpdateNormals(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xUpdateN(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xUpdateTB(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern int xMeshesBBIntersect(int entity1, int entity2);
        [DllImport("Xors3d.dll")] 
		public static extern int xMeshesIntersect(int entity1, int entity2);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetMeshVB(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetMeshIB(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetMeshVBSize(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetMeshIBSize(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xDeleteMeshVB(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xDeleteMeshIB(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern int xCountSurfaces(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetSurface(int entity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern int xCreatePivot(int parent = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xFindSurface(int entity, int brush);
        [DllImport("Xors3d.dll")] 
		public static extern int xCreatePoly(int sides, int parent = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xMeshSingleSurface(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern int xSaveMesh(int entity, string path);
        [DllImport("Xors3d.dll")] 
		public static extern void xLightMesh(int entity, int red, int green, int blue, float range = 0.0f, float lightX = 0.0f, float lightY = 0.0f, float lightZ = 0.0f);
        [DllImport("Xors3d.dll")] 
		public static extern void xMeshPrimitiveType(int entity, int ptype);
        
        // particles commands
        [DllImport("Xors3d.dll")] 
		public static extern void xParticlePosition(int particle, float x, float y, float z);
        [DllImport("Xors3d.dll")] 
		public static extern float xParticleX(int particle);
        [DllImport("Xors3d.dll")] 
		public static extern float xParticleY(int particle);
        [DllImport("Xors3d.dll")] 
		public static extern float xParticleZ(int particle);
        [DllImport("Xors3d.dll")] 
		public static extern void xParticleVeclocity(int particle, float x, float y, float z);
        [DllImport("Xors3d.dll")] 
		public static extern float xParticleVX(int particle);
        [DllImport("Xors3d.dll")] 
		public static extern float xParticleVY(int particle);
        [DllImport("Xors3d.dll")] 
		public static extern float xParticleVZ(int particle);
        [DllImport("Xors3d.dll")] 
		public static extern void xParticleRotation(int particle, float x, float y, float z);
        [DllImport("Xors3d.dll")] 
		public static extern float xParticlePitch(int particle);
        [DllImport("Xors3d.dll")] 
		public static extern float xParticleYaw(int particle);
        [DllImport("Xors3d.dll")] 
		public static extern float xParticleRoll(int particle);
        [DllImport("Xors3d.dll")] 
		public static extern void xParticleTorque(int particle, float x, float y, float z);
        [DllImport("Xors3d.dll")] 
		public static extern float xParticleTPitch(int particle);
        [DllImport("Xors3d.dll")] 
		public static extern float xParticleTYaw(int particle);
        [DllImport("Xors3d.dll")] 
		public static extern float xParticleTRoll(int particle);
        [DllImport("Xors3d.dll")] 
		public static extern void xParticleSetAlpha(int particle, float alpha);
        [DllImport("Xors3d.dll")] 
		public static extern float xParticleGetAlpha(int particle);
        [DllImport("Xors3d.dll")] 
		public static extern void xParticleColor(int particle, float x, float y, float z);
        [DllImport("Xors3d.dll")] 
		public static extern float xParticleRed(int particle);
        [DllImport("Xors3d.dll")] 
		public static extern float xParticleGreen(int particle);
        [DllImport("Xors3d.dll")] 
		public static extern float xParticleBlue(int particle);
        [DllImport("Xors3d.dll")] 
		public static extern void xParticleScale(int particle, float x, float y);
        [DllImport("Xors3d.dll")] 
		public static extern float xParticleSX(int particle);
        [DllImport("Xors3d.dll")] 
		public static extern float xParticleSY(int particle);
        [DllImport("Xors3d.dll")] 
		public static extern void xParticleScaleSpeed(int particle, float x, float y);
        [DllImport("Xors3d.dll")] 
		public static extern float xParticleScaleSpeedX(int particle);
        [DllImport("Xors3d.dll")] 
		public static extern float xParticleScaleSpeedY(int particle);
        
        // physics commands
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityAddDummyShape(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityAddBoxShape(int entity, float mass, float width = 0.0f, float height = 0.0f, float depth = 0.0f);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityAddSphereShape(int entity, float mass, float radius = 0.0f);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityAddCapsuleShape(int entity, float mass, float radius = 0.0f, float height = 0.0f);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityAddConeShape(int entity, float mass, float radius = 0.0f, float height = 0.0f);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityAddCylinderShape(int entity, float mass, float width = 0.0f, float height = 0.0f, float depth = 0.0f);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityAddTriMeshShape(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityAddTriMeshShapeProxy(int entity, int proxy);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityAddConvexShape(int entity, float mass);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityAddConvexShapeProxy(int entity, int proxy, float mass);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityAddConcaveShape(int entity, float mass);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityAddConcaveShapeProxy(int entity, int proxy, float mass);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityAddTerrainShape(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityAttachBody(int entity, int body);
        [DllImport("Xors3d.dll")] 
		public static extern int xEntityDetachBody(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xFreeEntityBody(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityAddCompoundShape(int entity, float mass);
        [DllImport("Xors3d.dll")] 
		public static extern int xEntityCompoundAddBox(int entity, float width, float height, float depth);
        [DllImport("Xors3d.dll")] 
		public static extern int xEntityCompoundAddSphere(int entity, float radius);
        [DllImport("Xors3d.dll")] 
		public static extern int xEntityCompoundAddCapsule(int entity, float radius, float height);
        [DllImport("Xors3d.dll")] 
		public static extern int xEntityCompoundAddCone(int entity, float radius, float height);
        [DllImport("Xors3d.dll")] 
		public static extern int xEntityCompoundAddCylinder(int entity, float radius, float height);
        [DllImport("Xors3d.dll")] 
		public static extern int xEntityCompoundCountChildren(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityCompoundRemoveChild(int entity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityCompoundChildSetPosition(int entity, int index, float x, float y, float z);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityCompoundChildGetX(int entity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityCompoundChildGetY(int entity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityCompoundChildGetZ(int entity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityCompoundChildSetRotation(int entity, int index, float pitch, float yaw, float roll);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityCompoundChildGetPitch(int entity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityCompoundChildGetYaw(int entity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityCompoundChildGetRoll(int entity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern int xCreateHingeJoint(int firstBody, int secondBody, float pivotX, float pivotY, float pivotZ, float axisX, float axisY, float axisZ, bool isGlobal = false);
        [DllImport("Xors3d.dll")] 
		public static extern int xCreateBallJoint(int firstBody, int secondBody, float pivotX, float pivotY, float pivotZ, bool isGlobal = false);
        [DllImport("Xors3d.dll")] 
		public static extern int xCreateD6Joint(int firstBody, int secondBody, float pivot1X, float pivot1Y, float pivot1Z, float pivot2X, float pivot2Y, float pivot2Z, bool isGlobal1 = false, bool isGlobal2 = false);
        [DllImport("Xors3d.dll")] 
		public static extern int xCreateD6SpringJoint(int firstBody, int secondBody, float pivot1X, float pivot1Y, float pivot1Z, float pivot2X, float pivot2Y, float pivot2Z, bool isGlobal1 = false, bool isGlobal2 = false);
        [DllImport("Xors3d.dll")] 
		public static extern float xJointHingeGetAngle(int joint);
        [DllImport("Xors3d.dll")] 
		public static extern float xJointD6GetPitchAngle(int joint);
        [DllImport("Xors3d.dll")] 
		public static extern float xJointD6GetYawAngle(int joint);
        [DllImport("Xors3d.dll")] 
		public static extern float xJointD6GetRollAngle(int joint);
        [DllImport("Xors3d.dll")] 
		public static extern float xJointD6GetAngle(int joint, int axis = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xJointDisableCollisions(int joint, int state);
        [DllImport("Xors3d.dll")] 
		public static extern void xJointEnable(int joint, int state);
        [DllImport("Xors3d.dll")] 
		public static extern int xJointIsEnabled(int joint);
        [DllImport("Xors3d.dll")] 
		public static extern float xJointGetImpulse(int joint);
        [DllImport("Xors3d.dll")] 
		public static extern void xFreeJoint(int joint);
        [DllImport("Xors3d.dll")] 
		public static extern void xJointBallSetPivot(int joint, float x, float y, float z, bool isGlobal = false);
        [DllImport("Xors3d.dll")] 
		public static extern float xJointBallGetPivotX(int joint, bool isGlobal = false);
        [DllImport("Xors3d.dll")] 
		public static extern float xJointBallGetPivotY(int joint, bool isGlobal = false);
        [DllImport("Xors3d.dll")] 
		public static extern float xJointBallGetPivotZ(int joint, bool isGlobal = false);
        [DllImport("Xors3d.dll")] 
		public static extern void xJointD6SetLimits(int joint, int axis, float lower, float upper);
        [DllImport("Xors3d.dll")] 
		public static extern void xJointD6SetLowerLinearLimits(int joint, float lowerX, float lowerY, float lowerZ);
        [DllImport("Xors3d.dll")] 
		public static extern void xJointD6SetUpperLinearLimits(int joint, float upperX, float upperY, float upperZ);
        [DllImport("Xors3d.dll")] 
		public static extern void xJointD6SetLowerAngularLimits(int joint, float lowerX, float lowerY, float lowerZ);
        [DllImport("Xors3d.dll")] 
		public static extern void xJointD6SetUpperAngularLimits(int joint, float upperX, float upperY, float upperZ);
        [DllImport("Xors3d.dll")] 
		public static extern void xJointD6SetLinearLimits(int joint, float lowerX, float lowerY, float lowerZ, float upperX, float upperY, float upperZ);
        [DllImport("Xors3d.dll")] 
		public static extern void xJointD6SetAngularLimits(int joint, float lowerX, float lowerY, float lowerZ, float upperX, float upperY, float upperZ);
        [DllImport("Xors3d.dll")] 
		public static extern float xJointD6GetLinearLowerX(int joint);
        [DllImport("Xors3d.dll")] 
		public static extern float xJointD6GetLinearLowerY(int joint);
        [DllImport("Xors3d.dll")] 
		public static extern float xJointD6GetLinearLowerZ(int joint);
        [DllImport("Xors3d.dll")] 
		public static extern float xJointD6GetLinearUpperX(int joint);
        [DllImport("Xors3d.dll")] 
		public static extern float xJointD6GetLinearUpperY(int joint);
        [DllImport("Xors3d.dll")] 
		public static extern float xJointD6GetLinearUpperZ(int joint);
        [DllImport("Xors3d.dll")] 
		public static extern float xJointD6GetAngularLowerX(int joint);
        [DllImport("Xors3d.dll")] 
		public static extern float xJointD6GetAngularLowerY(int joint);
        [DllImport("Xors3d.dll")] 
		public static extern float xJointD6GetAngularLowerZ(int joint);
        [DllImport("Xors3d.dll")] 
		public static extern float xJointD6GetAngularUpperX(int joint);
        [DllImport("Xors3d.dll")] 
		public static extern float xJointD6GetAngularUpperY(int joint);
        [DllImport("Xors3d.dll")] 
		public static extern float xJointD6GetAngularUpperZ(int joint);
        [DllImport("Xors3d.dll")] 
		public static extern void xJointD6SpringSetParam(int joint, int index, int enabled, float damping = 1.0f, float stiffness = 1.0f);
        [DllImport("Xors3d.dll")] 
		public static extern void xJointHingeSetAxis(int joint, float x, float y, float z);
        [DllImport("Xors3d.dll")] 
		public static extern void xJointHingeSetLimits(int joint, float lowerLimit, float upperLimit, float softness = 0.9f, float biasFactor = 0.3f, float relaxationFactor = 1.0f);
        [DllImport("Xors3d.dll")] 
		public static extern float xJointHingeGetLowerLimit(int joint);
        [DllImport("Xors3d.dll")] 
		public static extern float xJointHingeGetUpperLimit(int joint);
        [DllImport("Xors3d.dll")] 
		public static extern void xJointEnableMotor(int joint, int enabled, float targetVelocity, float maxForce, int index = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xJointHingeSetMotorTarget(int joint, float targetAngle, float deltaTime);
        [DllImport("Xors3d.dll")] 
		public static extern int xJointGetEntityA(int joint);
        [DllImport("Xors3d.dll")] 
		public static extern int xJointGetEntityB(int joint);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityApplyCentralForce(int entity, float x, float y, float z, bool isGlobal = true);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityApplyCentralImpulse(int entity, float x, float y, float z, bool isGlobal = true);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityApplyTorque(int entity, float x, float y, float z, bool isGlobal = true);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityApplyTorqueImpulse(int entity, float x, float y, float z, bool isGlobal = true);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityApplyForce(int entity, float x, float y, float z, float pointx, float pointy, float pointz, bool isGlobal = true, bool globalPoint = true);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityApplyImpulse(int entity, float x, float y, float z, float pointx, float pointy, float pointz, bool isGlobal = true, bool globalPoint = true);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityReleaseForces(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xWorldSetGravity(float x, float y, float z, int world = 0);
        [DllImport("Xors3d.dll")] 
		public static extern float xWorldGetGravityX(int world = 0);
        [DllImport("Xors3d.dll")] 
		public static extern float xWorldGetGravityY(int world = 0);
        [DllImport("Xors3d.dll")] 
		public static extern float xWorldGetGravityZ(int world = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntitySetGravity(int entity, float x, float y, float z);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetGravityX(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetGravityY(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetGravityZ(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntitySetLinearVelocity(int entity, float x, float y, float z, bool isGlobal = true);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetLinearVelocityX(int entity, bool isGlobal = true);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetLinearVelocityY(int entity, bool isGlobal = true);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetLinearVelocityZ(int entity, bool isGlobal = true);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntitySetAngularVelocity(int entity, float x, float y, float z, bool isGlobal = true);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetAngularVelocityX(int entity, bool isGlobal = true);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetAngularVelocityY(int entity, bool isGlobal = true);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetAngularVelocityZ(int entity, bool isGlobal = true);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntitySetDamping(int entity, float linear, float angular);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetLinearDamping(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetAngularDamping(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntitySetFriction(int entity, float friction);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetFriction(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntitySetAnisotropicFriction(int entity, float fx, float fy, float fz);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetAnisotropicFrictionX(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetAnisotropicFrictionY(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetAnisotropicFrictionZ(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntitySetLinearFactor(int entity, float x, float y, float z);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetLinearFactorX(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetLinearFactorY(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetLinearFactorZ(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntitySetAngularFactor(int entity, float x, float y, float z);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetAngularFactorX(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetAngularFactorY(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetAngularFactorZ(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntitySetRestitution(int entity, float restitution);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetRestitution(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntitySetMass(int entity, float mass);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetMass(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern int xEntityCountContacts(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetContactX(int entity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetContactY(int entity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetContactZ(int entity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetContactNX(int entity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetContactNY(int entity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetContactNZ(int entity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetContactDistance(int entity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern int xEntityGetContact(int entity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetContactImpulse(int entity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntitySetCollisionGroup(int entity, int group);
        [DllImport("Xors3d.dll")] 
		public static extern int xEntityGetCollisionGroup(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntitySetContactGroup(int entity, int group);
        [DllImport("Xors3d.dll")] 
		public static extern int xEntityGetContactGroup(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntitySetRaycastGroup(int entity, int group);
        [DllImport("Xors3d.dll")] 
		public static extern int xEntityGetRaycastGroup(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xPhysicsSetCollisionFilter(int group0, int group1, int state);
        [DllImport("Xors3d.dll")] 
		public static extern int xPhysicsGetCollisionFilter(int group0, int group1);
        [DllImport("Xors3d.dll")] 
		public static extern void xPhysicsSetContactFilter(int group0, int group1, int state);
        [DllImport("Xors3d.dll")] 
		public static extern int xPhysicsGetContactFilter(int group0, int group1);
        [DllImport("Xors3d.dll")] 
		public static extern void xPhysicsSetRaycastFilter(int rayGroup, int bodyGroup, int state);
        [DllImport("Xors3d.dll")] 
		public static extern int xPhysicsGetRaycastFilter(int rayGroup, int bodyGroup);
        [DllImport("Xors3d.dll")] 
		public static extern int xEntityIsSleeping(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityDisableSleeping(int entity, int state = 1);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityWakeUp(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntitySleep(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntitySetSleepingThresholds(int entity, float linearThreshold, float angularThreshold);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetLinearSleepingThreshold(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityGetAngularSleepingThreshold(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xPhysicsRayCast(float fromX, float fromY, float fromZ, float toX, float toY, float toZ, int rcType = 0, int rayGroup = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xPhysicsGetHitEntity(int index = 0);
        [DllImport("Xors3d.dll")] 
		public static extern float xPhysicsGetHitPointX(int index = 0);
        [DllImport("Xors3d.dll")] 
		public static extern float xPhysicsGetHitPointY(int index = 0);
        [DllImport("Xors3d.dll")] 
		public static extern float xPhysicsGetHitPointZ(int index = 0);
        [DllImport("Xors3d.dll")] 
		public static extern float xPhysicsGetHitNormalX(int index = 0);
        [DllImport("Xors3d.dll")] 
		public static extern float xPhysicsGetHitNormalY(int index = 0);
        [DllImport("Xors3d.dll")] 
		public static extern float xPhysicsGetHitNormalZ(int index = 0);
        [DllImport("Xors3d.dll")] 
		public static extern float xPhysicsGetHitDistance(int index = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xPhysicsCountHits();
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityBodyLocalPosition(int entity, float x, float y, float z);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityBodyLocalRotation(int entity, float pitch, float yaw, float roll);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityBodyLocalScale(int entity, float x, float y, float z);
        [DllImport("Xors3d.dll")] 
		public static extern void xWorldSetFrequency(float frequency, int world = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityMakeKinematic(int entity, int state);
        [DllImport("Xors3d.dll")] 
		public static extern int xEntityIsKinematic(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xPhysicsDebugRender(int state);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityDisableSimulation(int entity, int state);
        [DllImport("Xors3d.dll")] 
		public static extern int xEntityHasBody(int entity);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityCreateVehicle(int chassisEntity);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityFreeVehicle(int chassisEntity);
        [DllImport("Xors3d.dll")] 
		public static extern int xEntityCountWheels(int chassisEntity);
        [DllImport("Xors3d.dll")] 
		public static extern int xEntityAddWheel(int chassisEntity, int wheelEntity);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityWheelSetRadius(int chassisEntity, int index, float radius);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityWheelSetAxle(int chassisEntity, int index, float x, float y, float z);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityWheelSetRay(int chassisEntity, int index, float x, float y, float z);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityWheelSetSuspensionLength(int chassisEntity, int index, float length);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityWheelSetBrake(int chassisEntity, int index, float brake);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityWheelSetMaxSuspensionForce(int chassisEntity, int index, float force);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityWheelSetMaxSuspensionTravel(int chassisEntity, int index, float travel);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityWheelSetSuspensionStiffness(int chassisEntity, int index, float stiffness);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityWheelSetSuspensionDamping(int chassisEntity, int index, float damping);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityWheelSetSuspensionCompression(int chassisEntity, int index, float compression);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityWheelSetFriction(int chassisEntity, int index, float friction);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityWheelSetEngineForce(int chassisEntity, int index, float force);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityWheelSetRollInfluence(int chassisEntity, int index, float roll);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityWheelSetRotation(int chassisEntity, int index, float rotation);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityWheelSetSteering(int chassisEntity, int index, float steering);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityWheelSetConnectionPoint(int chassisEntity, int index, float x, float y, float z, bool isGlobal = false);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityWheelGetSuspensionLength(int chassisEntity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityWheelGetPitch(int chassisEntity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityWheelGetYaw(int chassisEntity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern float xEntityWheelGetRoll(int chassisEntity, int index);
        [DllImport("Xors3d.dll")] 
		public static extern int xEntityWheelGetContactEntity(int chassisEntity, int index);
        
        // posteffects commands
        [DllImport("Xors3d.dll")] 
		public static extern int xLoadPostEffect(string path);
        [DllImport("Xors3d.dll")] 
		public static extern void xFreePostEffect(int postEffect);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetPostEffect(int index, int postEffect, string technique = "MainTechnique");
        [DllImport("Xors3d.dll")] 
		public static extern void xRenderPostEffects();
        [DllImport("Xors3d.dll")] 
		public static extern void xSetPostEffectInt(int postEffect, string name, int value);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetPostEffectFloat(int postEffect, string name, float value);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetPostEffectBool(int postEffect, string name, bool value);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetPostEffectVector(int postEffect, string name, float x, float y, float z, float w = 1.0f);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetPostEffectTexture(int postEffect, string name, int texture, int frame = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xDeletePostEffectConstant(int postEffect, string name);
        [DllImport("Xors3d.dll")] 
		public static extern void xClearPostEffectConstants(int postEffect);
        
        // psystems commands
        [DllImport("Xors3d.dll")] 
		public static extern int xCreatePSystem(bool pointSprites = false);
        [DllImport("Xors3d.dll")] 
		public static extern int xPSystemType(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern void xPSystemSetBlend(int psystem, int mode);
        [DllImport("Xors3d.dll")] 
		public static extern int xPSystemGetBlend(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern void xPSystemSetMaxParticles(int psystem, int maxNumber);
        [DllImport("Xors3d.dll")] 
		public static extern int xPSystemGetMaxParticles(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern void xPSystemSetEmitterLifetime(int psystem, int lifetime);
        [DllImport("Xors3d.dll")] 
		public static extern int xPSystemGetEmitterLifetime(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern void xPSystemSetParticleLifetime(int psystem, int lifetime);
        [DllImport("Xors3d.dll")] 
		public static extern int xPSystemGetParticleLifetime(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern void xPSystemSetCreationInterval(int psystem, int interval);
        [DllImport("Xors3d.dll")] 
		public static extern int xPSystemGetCreationInterval(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern void xPSystemSetCreationFrequency(int psystem, int frequency);
        [DllImport("Xors3d.dll")] 
		public static extern int xPSystemGetCreationFrequency(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern void xPSystemSetTexture(int psystem, int texture, int frames, float speed);
        [DllImport("Xors3d.dll")] 
		public static extern int xPSystemGetTexture(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern int xPSystemGetTextureFrames(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern int xPSystemGetTextureAnimationSpeed(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern void xPSystemSetOffset(int psystem, float minx, float miny, float minz, float maxx, float maxy, float maxz);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetOffsetMinX(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetOffsetMinY(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetOffsetMinZ(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetOffsetMaxX(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetOffsetMaxY(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetOffsetMaxZ(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern void xPSystemSetVelocity(int psystem, float minx, float miny, float minz, float maxx, float maxy, float maxz);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetVelocityMinX(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetVelocityMinY(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetVelocityMinZ(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetVelocityMaxX(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetVelocityMaxY(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetVelocityMaxZ(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern void xPSystemEnableFixedQuads(int psystem, bool state);
        [DllImport("Xors3d.dll")] 
		public static extern int xPSystemFixedQuadsUsed(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern void xPSystemSetTorque(int psystem, float minx, float miny, float minz, float maxx, float maxy, float maxz);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetTorqueMinX(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetTorqueMinY(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetTorqueMinZ(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetTorqueMaxX(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetTorqueMaxY(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetTorqueMaxZ(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern void xPSystemSetGravity(int psystem, float gravity);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetGravity(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern void xPSystemSetAlpha(int psystem, float alpha);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetAlpha(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern void xPSystemSetFadeSpeed(int psystem, float speed);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetFadeSpeed(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern void xPSystemSetParticleSize(int psystem, float minx, float miny, float maxx, float maxy);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetSizeMinX(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetSizeMinY(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetSizeMaxX(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetSizeMaxY(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern void xPSystemSetScaleSpeed(int psystem, float minx, float miny, float maxx, float maxy);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetScaleSpeedMinX(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetScaleSpeedMinY(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetScaleSpeedMaxX(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetScaleSpeedMaxY(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern void xPSystemSetAngles(int psystem, float minx, float miny, float minz, float maxx, float maxy, float maxz);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetAnglesMinX(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetAnglesMinY(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetAnglesMinZ(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetAnglesMaxX(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetAnglesMaxY(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetAnglesMaxZ(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern void xPSystemSetColorMode(int psystem, int mode);
        [DllImport("Xors3d.dll")] 
		public static extern int xPSystemGetColorMode(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern void xPSystemSetColors(int psystem, float sred, float sgreen, float sblue, float ered, float egreen, float eblue);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetBeginColorRed(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetBeginColorGreen(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetBeginColorBlue(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetEndColorRed(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetEndColorGreen(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern float xPSystemGetEndColorBlue(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern void xFreePSystem(int psystem);
        [DllImport("Xors3d.dll")] 
		public static extern void xPSystemSetParticleParenting(int psystem, bool mode);
        [DllImport("Xors3d.dll")] 
		public static extern int xPSystemGetParticleParenting(int psystem);
        
        // raypicks commands
        [DllImport("Xors3d.dll")] 
		public static extern int xLinePick(float x, float y, float z, float dx, float dy, float dz, float distance = 0.0f);
        [DllImport("Xors3d.dll")] 
		public static extern int xEntityPick(int entity, float range = 0.0f);
        [DllImport("Xors3d.dll")] 
		public static extern int xCameraPick(int camera, int x, int y);
        [DllImport("Xors3d.dll")] 
		public static extern float xPickedNX();
        [DllImport("Xors3d.dll")] 
		public static extern float xPickedNY();
        [DllImport("Xors3d.dll")] 
		public static extern float xPickedNZ();
        [DllImport("Xors3d.dll")] 
		public static extern float xPickedX();
        [DllImport("Xors3d.dll")] 
		public static extern float xPickedY();
        [DllImport("Xors3d.dll")] 
		public static extern float xPickedZ();
        [DllImport("Xors3d.dll")] 
		public static extern int xPickedEntity();
        [DllImport("Xors3d.dll")] 
		public static extern int xPickedSurface();
        [DllImport("Xors3d.dll")] 
		public static extern int xPickedTriangle();
        [DllImport("Xors3d.dll")] 
		public static extern int xPickedTime();
        
        // shadows commands
        [DllImport("Xors3d.dll")] 
		public static extern void xSetShadowsBlur(int blurLevel);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetShadowShader(string path);
        [DllImport("Xors3d.dll")] 
		public static extern int xInitShadows(int dirSize, int spotSize, int pointSize);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetShadowParams(int splitPlanes = 4, float splitLambda = 0.95f, bool useOrtho = true, float lightDist = 300.0f);
        [DllImport("Xors3d.dll")] 
		public static extern void xRenderShadows(int mainCamera, int texture);
        [DllImport("Xors3d.dll")] 
		public static extern void xShadowPriority(int priority);
        [DllImport("Xors3d.dll")] 
		public static extern void xCameraDisableShadows(int camera);
        [DllImport("Xors3d.dll")] 
		public static extern void xCameraEnableShadows(int camera);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityCastShadows(int entity, int light, bool state);
        [DllImport("Xors3d.dll")] 
		public static extern void xEntityReceiveShadows(int entity, int light, bool state);
        [DllImport("Xors3d.dll")] 
		public static extern int xEntityIsCaster(int entity, int light);
        [DllImport("Xors3d.dll")] 
		public static extern int xEntityIsReceiver(int entity, int light);
        
        // sounds commands
        [DllImport("Xors3d.dll")] 
		public static extern int xLoadSound(string path);
        [DllImport("Xors3d.dll")] 
		public static extern int xLoad3DSound(string path);
        [DllImport("Xors3d.dll")] 
		public static extern void xFreeSound(int sound);
        [DllImport("Xors3d.dll")] 
		public static extern void xLoopSound(int sound);
        [DllImport("Xors3d.dll")] 
		public static extern void xSoundPitch(int sound, int pitch);
        [DllImport("Xors3d.dll")] 
		public static extern void xSoundVolume(int sound, float volume);
        [DllImport("Xors3d.dll")] 
		public static extern void xSoundPan(int sound, float pan);
        [DllImport("Xors3d.dll")] 
		public static extern int xPlaySound(int sound);
        [DllImport("Xors3d.dll")] 
		public static extern void xStopChannel(int channel);
        [DllImport("Xors3d.dll")] 
		public static extern void xPauseChannel(int channel);
        [DllImport("Xors3d.dll")] 
		public static extern void xResumeChannel(int channel);
        [DllImport("Xors3d.dll")] 
		public static extern int xPlayMusic(string path);
        [DllImport("Xors3d.dll")] 
		public static extern void xChannelPitch(int channel, int pitch);
        [DllImport("Xors3d.dll")] 
		public static extern void xChannelVolume(int channel, float volume);
        [DllImport("Xors3d.dll")] 
		public static extern void xChannelPan(int channel, float pan);
        [DllImport("Xors3d.dll")] 
		public static extern int xChannelPlaying(int channel);
        [DllImport("Xors3d.dll")] 
		public static extern int xEmitSound(int sound, int entity);
        [DllImport("Xors3d.dll")] 
		public static extern int xCreateListener(int parent = 0, float roFactor = 1.0f, float doplerFactor = 1.0f, float distFactor = 1.0f);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetListener();
        [DllImport("Xors3d.dll")] 
		public static extern int xInitalizeSound();
        
        // sprites commands
        [DllImport("Xors3d.dll")] 
		public static extern int xCreateSprite(int parent = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xSpriteViewMode(int sprite, int mode);
        [DllImport("Xors3d.dll")] 
		public static extern void xintSprite(int sprite, float x, float y);
        [DllImport("Xors3d.dll")] 
		public static extern int xLoadSprite(string path, int flags = 9, int parent = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xRotateSprite(int sprite, float angle);
        [DllImport("Xors3d.dll")] 
		public static extern void xScaleSprite(int sprite, float xScale, float yScale);
        
        // surfaces commands
        [DllImport("Xors3d.dll")] 
		public static extern int xCreateSurface(int entity, int brush = 0, bool dynamic = false);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetSurfaceBrush(int surface);
        [DllImport("Xors3d.dll")] 
		public static extern int xAddVertex(int surface, float x, float y, float z, float u = 0.0f, float v = 0.0f, float w = 0.0f);
        [DllImport("Xors3d.dll")] 
		public static extern int xAddTriangle(int surface, int v0, int v1, int v2);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetSurfaceFrustumSphere(int surface, float x, float y, float z, float radii);
        [DllImport("Xors3d.dll")] 
		public static extern void xVertexCoords(int surface, int vertex, float x, float y, float z);
        [DllImport("Xors3d.dll")] 
		public static extern void xVertexNormal(int surface, int vertex, float x, float y, float z);
        [DllImport("Xors3d.dll")] 
		public static extern void xVertexTangent(int surface, int vertex, float x, float y, float z);
        [DllImport("Xors3d.dll")] 
		public static extern void xVertexBinormal(int surface, int vertex, float x, float y, float z);
        [DllImport("Xors3d.dll")] 
		public static extern void xVertexColor(int surface, int vertex, int red, int green, int blue, float alpha = 1.0f);
        [DllImport("Xors3d.dll")] 
		public static extern void xVertexTexCoords(int surface, int vertex, float u, float v, float w = 1.0f, int textureSet = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xCountVertices(int surface);
        [DllImport("Xors3d.dll")] 
		public static extern float xVertexX(int surface, int vertex);
        [DllImport("Xors3d.dll")] 
		public static extern float xVertexY(int surface, int vertex);
        [DllImport("Xors3d.dll")] 
		public static extern float xVertexZ(int surface, int vertex);
        [DllImport("Xors3d.dll")] 
		public static extern float xVertexNX(int surface, int vertex);
        [DllImport("Xors3d.dll")] 
		public static extern float xVertexNY(int surface, int vertex);
        [DllImport("Xors3d.dll")] 
		public static extern float xVertexNZ(int surface, int vertex);
        [DllImport("Xors3d.dll")] 
		public static extern float xVertexTX(int surface, int vertex);
        [DllImport("Xors3d.dll")] 
		public static extern float xVertexTY(int surface, int vertex);
        [DllImport("Xors3d.dll")] 
		public static extern float xVertexTZ(int surface, int vertex);
        [DllImport("Xors3d.dll")] 
		public static extern float xVertexBX(int surface, int vertex);
        [DllImport("Xors3d.dll")] 
		public static extern float xVertexBY(int surface, int vertex);
        [DllImport("Xors3d.dll")] 
		public static extern float xVertexBZ(int surface, int vertex);
        [DllImport("Xors3d.dll")] 
		public static extern float xVertexU(int surface, int vertex, int textureSet = 0);
        [DllImport("Xors3d.dll")] 
		public static extern float xVertexV(int surface, int vertex, int textureSet = 0);
        [DllImport("Xors3d.dll")] 
		public static extern float xVertexW(int surface, int vertex, int textureSet = 0);
        [DllImport("Xors3d.dll")] 
		public static extern float xVertexRed(int surface, int vertex);
        [DllImport("Xors3d.dll")] 
		public static extern float xVertexGreen(int surface, int vertex);
        [DllImport("Xors3d.dll")] 
		public static extern float xVertexBlue(int surface, int vertex);
        [DllImport("Xors3d.dll")] 
		public static extern float xVertexAlpha(int surface, int vertex);
        [DllImport("Xors3d.dll")] 
		public static extern int xTriangleVertex(int surface, int triangle, int corner);
        [DllImport("Xors3d.dll")] 
		public static extern int xCountTriangles(int surface);
        [DllImport("Xors3d.dll")] 
		public static extern void xPaintSurface(int surface, int brush);
        [DllImport("Xors3d.dll")] 
		public static extern void xClearSurface(int surface, bool vertices = true, bool triangles = true);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetSurfaceTexture(int surface, int index = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xFreeSurface(int surface);
        [DllImport("Xors3d.dll")] 
		public static extern void xSurfacePrimitiveType(int surface, int ptype);
        [DllImport("Xors3d.dll")] 
		public static extern void xSurfaceTexture(int surface, int texture, int frame, int index);
        [DllImport("Xors3d.dll")] 
		public static extern void xSurfaceColor(int surface, int red, int green, int blue);
        [DllImport("Xors3d.dll")] 
		public static extern void xSurfaceAlpha(int surface, float alpha);
        [DllImport("Xors3d.dll")] 
		public static extern void xSurfaceShininess(int surface, float shininess);
        [DllImport("Xors3d.dll")] 
		public static extern void xSurfaceBlend(int surface, int blendMode);
        [DllImport("Xors3d.dll")] 
		public static extern void xSurfaceFX(int surface, int fxFlags);
        [DllImport("Xors3d.dll")] 
		public static extern void xSurfaceAlphaRef(int surface, int alphaRef);
        [DllImport("Xors3d.dll")] 
		public static extern void xSurfaceAlphaFunc(int surface, int alphaFunc);
        
        // sysinfos commands
        [DllImport("Xors3d.dll")] 
		public static extern string xCPUName();
        [DllImport("Xors3d.dll")] 
		public static extern string xCPUVendor();
        [DllImport("Xors3d.dll")] 
		public static extern int xCPUFamily();
        [DllImport("Xors3d.dll")] 
		public static extern int xCPUModel();
        [DllImport("Xors3d.dll")] 
		public static extern int xCPUStepping();
        [DllImport("Xors3d.dll")] 
		public static extern System.Int32 xCPUSpeed();
        [DllImport("Xors3d.dll")] 
		public static extern string xVideoInfo();
        [DllImport("Xors3d.dll")] 
		public static extern float xVideoAspectRatio();
        [DllImport("Xors3d.dll")] 
		public static extern string xVideoAspectRatioStr();
        [DllImport("Xors3d.dll")] 
		public static extern float xGetTotalPhysMem();
        [DllImport("Xors3d.dll")] 
		public static extern float xGetAvailPhysMem();
        [DllImport("Xors3d.dll")] 
		public static extern float xGetTotalPageMem();
        [DllImport("Xors3d.dll")] 
		public static extern float xGetAvailPageMem();
        [DllImport("Xors3d.dll")] 
		public static extern float xGetTotalVidMem();
        [DllImport("Xors3d.dll")] 
		public static extern float xGetAvailVidMem();
        [DllImport("Xors3d.dll")] 
		public static extern float xGetTotalVidLocalMem();
        [DllImport("Xors3d.dll")] 
		public static extern float xGetAvailVidLocalMem();
        [DllImport("Xors3d.dll")] 
		public static extern float xGetTotalVidNonlocalMem();
        [DllImport("Xors3d.dll")] 
		public static extern float xGetAvailVidNonlocalMem();
        [DllImport("Xors3d.dll")] 
		public static extern string xGetXors3dVersion();
        [DllImport("Xors3d.dll")] 
		public static extern int xGetXors3dMajorVersion();
        [DllImport("Xors3d.dll")] 
		public static extern int xGetXors3dMinorVersion();
        [DllImport("Xors3d.dll")] 
		public static extern int xGetXors3dRevision();
        
        // terrains commands
        [DllImport("Xors3d.dll")] 
		public static extern int xLoadTerrain(string path, int parent = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xCreateTerrain(int size, int parent = 0);
        [DllImport("Xors3d.dll")] 
		public static extern void xTerrainShading(int terrain, bool state = false);
        [DllImport("Xors3d.dll")] 
		public static extern float xTerrainHeight(int terrain, int x, int y);
        [DllImport("Xors3d.dll")] 
		public static extern int xTerrainSize(int terrain);
        [DllImport("Xors3d.dll")] 
		public static extern float xTerrainX(int terrain, float x, float y, float z);
        [DllImport("Xors3d.dll")] 
		public static extern float xTerrainY(int terrain, float x, float y, float z);
        [DllImport("Xors3d.dll")] 
		public static extern float xTerrainZ(int terrain, float x, float y, float z);
        [DllImport("Xors3d.dll")] 
		public static extern void xModifyTerrain(int terrain, int x, int y, float height, bool realtime = false);
        [DllImport("Xors3d.dll")] 
		public static extern void xTerrainDetail(int terrain, int detail);
        [DllImport("Xors3d.dll")] 
		public static extern void xTerrainSplatting(int terrain, bool state);
        [DllImport("Xors3d.dll")] 
		public static extern int xLoadTerrainTexture(string path);
        [DllImport("Xors3d.dll")] 
		public static extern void xFreeTerrainTexture(int texture);
        [DllImport("Xors3d.dll")] 
		public static extern void xTerrainTextureLightmap(int texture, bool state);
        [DllImport("Xors3d.dll")] 
		public static extern void xTerrainTexture(int terrain, int texture);
        [DllImport("Xors3d.dll")] 
		public static extern void xTerrainViewZone(int terrain, int viewZone, int texturingZone = -1);
        [DllImport("Xors3d.dll")] 
		public static extern void xTerrainLODs(int lodsCount);
        
        // textures commands
        [DllImport("Xors3d.dll")] 
		public static extern int xTextureWidth(int texture);
        [DllImport("Xors3d.dll")] 
		public static extern int xTextureHeight(int texture);
        [DllImport("Xors3d.dll")] 
		public static extern int xCreateTexture(int width, int height, int flags = 9, int frames = 1);
        [DllImport("Xors3d.dll")] 
		public static extern void xFreeTexture(int texture);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetTextureFilter(int texture, int mode);
        [DllImport("Xors3d.dll")] 
		public static extern void xTextureBlend(int texture, int blend);
        [DllImport("Xors3d.dll")] 
		public static extern void xTextureCoords(int texture, int coords);
        [DllImport("Xors3d.dll")] 
		public static extern void xTextureFilter(string matchText, int flags);
        [DllImport("Xors3d.dll")] 
		public static extern void xClearTextureFilters();
        [DllImport("Xors3d.dll")] 
		public static extern int xLoadTexture(string path, int flags = 9);
        [DllImport("Xors3d.dll")] 
		public static extern string xTextureName(int texture);
        [DllImport("Xors3d.dll")] 
		public static extern void xPositionTexture(int texture, float x, float y);
        [DllImport("Xors3d.dll")] 
		public static extern void xScaleTexture(int texture, float x, float y);
        [DllImport("Xors3d.dll")] 
		public static extern void xRotateTexture(int texture, float angle);
        [DllImport("Xors3d.dll")] 
		public static extern int xLoadAnimTexture(string path, int flags, int width, int height, int startFrame, int frames);
        [DllImport("Xors3d.dll")] 
		public static extern int xCreateTextureFromData(int pixelsData, int width, int height, int flags = 9, int frames = 1);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetTextureData(int texture, int frame = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetTextureDataPitch(int texture, int frame = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetTextureSurface(int texture, int frame = 0);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetTextureFrames(int texture);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetCubeFace(int texture, int face);
        [DllImport("Xors3d.dll")] 
		public static extern void xSetCubeMode(int texture, int mode);
        
        // transforms commands
        [DllImport("Xors3d.dll")] 
		public static extern float xVectorPitch(float x, float y, float z);
        [DllImport("Xors3d.dll")] 
		public static extern float xVectorYaw(float x, float y, float z);
        [DllImport("Xors3d.dll")] 
		public static extern float xDeltaPitch(int entity1, int entity2);
        [DllImport("Xors3d.dll")] 
		public static extern float xDeltaYaw(int entity1, int entity2);
        [DllImport("Xors3d.dll")] 
		public static extern float xTFormedX();
        [DllImport("Xors3d.dll")] 
		public static extern float xTFormedY();
        [DllImport("Xors3d.dll")] 
		public static extern float xTFormedZ();
        [DllImport("Xors3d.dll")] 
		public static extern void xTFormPoint(float x, float y, float z, int source, int destination);
        [DllImport("Xors3d.dll")] 
		public static extern void xTFormVector(float x, float y, float z, int source, int destination);
        [DllImport("Xors3d.dll")] 
		public static extern void xTFormNormal(float x, float y, float z, int source, int destination);
        
        // videos commands
        [DllImport("Xors3d.dll")] 
		public static extern int xOpenMovie(string path);
        [DllImport("Xors3d.dll")] 
		public static extern void xCloseMovie(int video);
        [DllImport("Xors3d.dll")] 
		public static extern void xDrawMovie(int video, int x = 0, int y = 0, int width = -1, int height = -1);
        [DllImport("Xors3d.dll")] 
		public static extern int xMovieWidth(int video);
        [DllImport("Xors3d.dll")] 
		public static extern int xMovieHeight(int video);
        [DllImport("Xors3d.dll")] 
		public static extern int xMoviePlaying(int video);
        [DllImport("Xors3d.dll")] 
		public static extern void xMovieSeek(int video, float time, bool relative = false);
        [DllImport("Xors3d.dll")] 
		public static extern float xMovieLength(int video);
        [DllImport("Xors3d.dll")] 
		public static extern float xMovieCurrentTime(int video);
        [DllImport("Xors3d.dll")] 
		public static extern void xMoviePause(int video);
        [DllImport("Xors3d.dll")] 
		public static extern void xMovieResume(int video);
        [DllImport("Xors3d.dll")] 
		public static extern int xMovieTexture(int video);
        
        // worlds commands
        [DllImport("Xors3d.dll")] 
		public static extern int xCreateWorld();
        [DllImport("Xors3d.dll")] 
		public static extern void xSetActiveWorld(int world);
        [DllImport("Xors3d.dll")] 
		public static extern int xGetActiveWorld();
        [DllImport("Xors3d.dll")] 
		public static extern int xGetDefaultWorld();
        [DllImport("Xors3d.dll")] 
		public static extern void xDeleteWorld(int world);

        public const int MOUSE_LEFT = 1;
        public const int MOUSE_RIGHT = 2;
        public const int MOUSE_MIDDLE = 3;
        public const int MOUSE4 = 4;
        public const int MOUSE5 = 5;
        public const int MOUSE6 = 6;
        public const int MOUSE7 = 7;
        public const int MOUSE8 = 8;
        public const int KEY_ESCAPE = 1;
        public const int KEY_1 = 2;
        public const int KEY_2 = 3;
        public const int KEY_3 = 4;
        public const int KEY_4 = 5;
        public const int KEY_5 = 6;
        public const int KEY_6 = 7;
        public const int KEY_7 = 8;
        public const int KEY_8 = 9;
        public const int KEY_9 = 10;
        public const int KEY_0 = 11;
        public const int KEY_MINUS = 12;
        public const int KEY_EQUALS = 13;
        public const int KEY_BACK = 14;
        public const int KEY_TAB = 15;
        public const int KEY_Q = 16;
        public const int KEY_W = 17;
        public const int KEY_E = 18;
        public const int KEY_R = 19;
        public const int KEY_T = 20;
        public const int KEY_Y = 21;
        public const int KEY_U = 22;
        public const int KEY_I = 23;
        public const int KEY_O = 24;
        public const int KEY_P = 25;
        public const int KEY_LBRACKET = 26;
        public const int KEY_RBRACKET = 27;
        public const int KEY_RETURN = 28;
        public const int KEY_ENTER = KEY_RETURN;
        public const int KEY_LCONTROL = 29;
        public const int KEY_RCONTROL = 157;
        public const int KEY_A = 30;
        public const int KEY_S = 31;
        public const int KEY_D = 32;
        public const int KEY_F = 33;
        public const int KEY_G = 34;
        public const int KEY_H = 35;
        public const int KEY_J = 36;
        public const int KEY_K = 37;
        public const int KEY_L = 38;
        public const int KEY_SEMICOLON = 39;
        public const int KEY_APOSTROPHE = 40;
        public const int KEY_GRAVE = 41;
        public const int KEY_LSHIFT = 42;
        public const int KEY_BACKSLASH = 43;
        public const int KEY_Z = 44;
        public const int KEY_X = 45;
        public const int KEY_C = 46;
        public const int KEY_V = 47;
        public const int KEY_B = 48;
        public const int KEY_N = 49;
        public const int KEY_M = 50;
        public const int KEY_COMMA = 51;
        public const int KEY_PERIOD = 52;
        public const int KEY_SLASH = 53;
        public const int KEY_RSHIFT = 54;
        public const int KEY_MULTIPLY = 55;
        public const int KEY_MENU = 56;
        public const int KEY_SPACE = 57;
        public const int KEY_F1 = 59;
        public const int KEY_F2 = 60;
        public const int KEY_F3 = 61;
        public const int KEY_F4 = 62;
        public const int KEY_F5 = 63;
        public const int KEY_F6 = 64;
        public const int KEY_F7 = 65;
        public const int KEY_F8 = 66;
        public const int KEY_F9 = 67;
        public const int KEY_F10 = 68;
        public const int KEY_NUMLOCK = 69;
        public const int KEY_SCROLL = 70;
        public const int KEY_NUMPAD7 = 71;
        public const int KEY_NUMPAD8 = 72;
        public const int KEY_NUMPAD9 = 73;
        public const int KEY_SUBTRACT = 74;
        public const int KEY_NUMPAD4 = 75;
        public const int KEY_NUMPAD5 = 76;
        public const int KEY_NUMPAD6 = 77;
        public const int KEY_ADD = 78;
        public const int KEY_NUMPAD1 = 79;
        public const int KEY_NUMPAD2 = 80;
        public const int KEY_NUMPAD3 = 81;
        public const int KEY_NUMPAD0 = 82;
        public const int KEY_DECIMAL = 83;
        public const int KEY_TILD = 86;
        public const int KEY_F11 = 87;
        public const int KEY_F12 = 88;
        public const int KEY_NUMPADENTER = 156;
        public const int KEY_RMENU = 221;
        public const int KEY_PAUSE = 197;
        public const int KEY_HOME = 199;
        public const int KEY_UP = 200;
        public const int KEY_PRIOR = 201;
        public const int KEY_LEFT = 203;
        public const int KEY_RIGHT = 205;
        public const int KEY_END = 207;
        public const int KEY_DOWN = 208;
        public const int KEY_NEXT = 209;
        public const int KEY_INSERT = 210;
        public const int KEY_DELETE = 211;
        public const int KEY_LWIN = 219;
        public const int KEY_RWIN = 220;
        public const int KEY_BACKSPACE = KEY_BACK;
        public const int KEY_NUMPADSTAR = KEY_MULTIPLY;
        public const int KEY_RALT = 184;
        public const int KEY_CAPSLOCK = 58;
        public const int KEY_NUMPADMINUS = KEY_SUBTRACT;
        public const int KEY_NUMPADPLUS = KEY_ADD;
        public const int KEY_NUMPADPERIOD = KEY_DECIMAL;
        public const int KEY_DIVIDE = 181;
        public const int KEY_NUMPADSLASH = KEY_DIVIDE;
        public const int KEY_LALT = 56;
        public const int KEY_UPARROW = KEY_UP;
        public const int KEY_PGUP = KEY_PRIOR;
        public const int KEY_LEFTARROW = KEY_LEFT;
        public const int KEY_RIGHTARROW = KEY_RIGHT;
        public const int KEY_DOWNARROW = KEY_DOWN;
        public const int KEY_PGDN = KEY_NEXT;

    }
}
